package com.hlk.article.consumer;

import com.hlk.article.service.ArticleService;
import com.hlk.config.RabbitmqConfig;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @author hlk
 * @version 1.0
 * @date 2021-01-15 10:24
 */
@Component
public class ArticleDelayConsume {
    @Autowired
    private ArticleService articleService;

    @RabbitListener(queues = {RabbitmqConfig.QUEUE_DELAY})
    public void watchQueue(String payload) {

        articleService.updateArticleToPublish(payload);

    }

}
